# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: George Rawlinson <george@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Georg Grabler (STiAT) <ggrabler@gmail.com>

pkgname=proxytunnel
pkgver=1.11.1
pkgrel=1
pkgdesc="Creates tunnels through HTTP(S) proxies for any TCP based protocol"
arch=('loong64' 'x86_64')
url="https://github.com/proxytunnel/proxytunnel"
license=('GPL')
depends=('glibc' 'openssl')
makedepends=('asciidoc' 'xmlto')
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
b2sums=('fb24dcf5351eb252d7ba661c667cab25066592f6b7356360225d1492fcb621a39954062ebeb63c5cc1b9b66499538d69b8412ee6a770c88257f4ef0397f627c0')

prepare() {
  cd "$pkgname-$pkgver"
  # append -DOPENSSL11 to CFLAGS via SSL-specific OPTFLAGS: See ptstream.c
  sed -i '/^OPTFLAGS += -DUSE_SSL$/ s/$/ -DOPENSSL11/' Makefile
  # fixup modes otherwise strip fails
  sed -i 's|555|755|g' Makefile
}

build() {
  cd "$pkgname-$pkgver"
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  make prefix=/usr
}

package() {
  cd "$pkgname-$pkgver"
  make prefix=/usr DESTDIR="$pkgdir" install
}

# vim: ts=2 sw=2 et:
